import {IWxJsSDKCommonParam} from "../IWxJsSDKCommonParam";
import {IWxJsSDKDownloadImageParam, IWxJsSDKUploadImageParam} from "./CategoryImage";

export default interface CategoryAudio {

    startRecord(): void;

    stopRecord(param: IWxJsSDKStopRecordParam): void;

    onVoiceRecordEnd(param: IWxJsSDKOnVoiceRecordEndParam): void;

    playVoice(param: { localId: string; }): void;

    pauseVoice(param: { localId: string; }): void;

    stopVoice(param: { localId: string; }): void;

    onVoicePlayEnd(param: { success(res: { localId: string; errMsg: string; }): void;/* 返回音频的本地ID*/ }): void;

    uploadVoice(param: IWxJsSDKUploadImageParam): void;

    downloadVoice(param: IWxJsSDKDownloadImageParam): void;

}

export interface IWxJsSDKOnVoiceRecordEndParam {
    complete?: (res: { localId: string; errMsg: string; }) => void;
}

export interface IWxJsSDKStopRecordParam extends IWxJsSDKCommonParam {
    success(param: { localId: string; errMsg: string; }): void;
}
